package com.pg.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pg.entity.cj.Sd;
import com.pg.mapper.SdMapper;
import com.pg.service.SdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 湿度 服务实现类
 * </p>
 *
 * @author likl
 * @since 2020-07-06
 */
@Service
@DS("proxyDs")
@Primary
public class SdServiceImpl extends ServiceImpl<SdMapper, Sd> implements SdService {

    @Autowired
    private SdMapper sdMapper;

    @Override
    public List<Sd> selectForList(Page<?> page, Sd sd, Date startCheckTime, Date endCheckTime) {
        if (null == sd) {
            return sdMapper.selectForList(page, null, null, null, null, null, null, null, null);
        }
        return sdMapper.selectForList(page, sd.getSupplierWorkNo(), sd.getSupplierCode(), sd.getCategoryType(), sd.getEquipmentName(), startCheckTime, endCheckTime, sd.getPdCode(), sd.getProductModel());
    }
}
